package com.managerstudy.managerback.utils;

public class BaseResult {

    private String code;
    private String msg;
    private Object data;



    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }


    //不带参数的返回成功
    public static BaseResult success() {
        BaseResult baseresult = new BaseResult();
        baseresult.setCode("200");
        baseresult.setMsg("success");
        return baseresult;
    }

    //带参数的返回成功
    public static BaseResult success(Object data) {
        BaseResult result1 = new BaseResult();
        result1.setCode("200");
        result1.setMsg("success");
        result1.setData(data);
        return result1;

    }

    //返回失败
    public static BaseResult error() {
        BaseResult result = new BaseResult();
        result.setCode("500");
        result.setMsg("error");
        return result;

    }

}


